/***************************************************************************
 *   Copyright (C) 2011 by The rPem3d developers                           *
 *   elseifkk@users.sf.net                                                 *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 *                                                                         *
 *   You should have received a copy of the GNU General Public License     *
 *   along with this program; if not, write to the                         *
 *   Free Software Foundation, Inc.,                                       *
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
 ***************************************************************************/
#ifndef BARCHART_H
#define BARCHART_H

#include <qwidget.h>

QColor const hist_col="lightpink";
QColor const hist_col2="royalblue";
QColor const border_col="darkred";
QColor const bar_col="gray24";

class BarChart : public QWidget {
    Q_OBJECT

public:
    BarChart ( QWidget *parent=0, const char *name=0 );
    ~BarChart();

public:
    void initBarChart(float max=0);
    void updateBarChart(float x, float max=0, float x2=0);
    QPixmap *thePm;
    QPixmap *lastPm;
    void drawMeasure(QPainter*);
    float tmp_mean;
    float tmp_max;
    int tmp_count;
    float getMean();
    float getMax();
    void resetMeanMax();

private:
    float ymax;

private slots:

protected:
    void        mousePressEvent ( QMouseEvent * );
    void 	paintEvent(QPaintEvent *);
};
#endif
